package org.itboys.mobile.entity.mysql;




import org.itboys.mysql.entity.BaseMySqlEntity;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 作者：jiangxiong
 * 日期：2017年10月26日
 * 联系方式 ：empty90911@126.com
 * 天街__钱包_区块链_实体
 */
public class TianJieWalletBlockRecord extends BaseMySqlEntity {


    private Long memberId;//用户ID
    private Long blockWalletId;//区块链钱包ID
    private BigDecimal totalAmount;//交易总金额
    private BigDecimal amount;//交易单价
    private BigDecimal blockNumber;//交易数量
    private BigDecimal ableAmount;//当前可用金额
    private Integer type;//交易类型。1，买入，2卖出，3退出区块链，4消费卡转入
    private Integer status;//1委托中，2已成交,
    private String remark;//交易备注。
    private Integer isSale;//是否卖出。0否（默认）
    private String bitAddress;//卖出的比特币地址
  //  private Date saleTime;//预计卖出时间
    //交易相关
    private String memberName;//用户名称。动态查询
    private String memberMobile;//用户手机号。动态查询
    //2017年12月25日，
    private Date saleTime;//预计卖出时间。针对买入记录，自动生成卖出记录时生成
    public TianJieWalletBlockRecord() {

    }

    public TianJieWalletBlockRecord(Long memberId, Long blockWalletId, BigDecimal totalAmount, BigDecimal amount, BigDecimal blockNumber, BigDecimal ableAmount, Integer type, Integer status, String remark) {
        this.memberId = memberId;
        this.blockWalletId = blockWalletId;
        this.totalAmount = totalAmount;
        this.amount = amount;
        this.blockNumber = blockNumber;
        this.ableAmount = ableAmount;
        this.type = type;
        this.status = status;
        this.remark = remark;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getBlockWalletId() {
        return blockWalletId;
    }

    public void setBlockWalletId(Long blockWalletId) {
        this.blockWalletId = blockWalletId;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getBlockNumber() {
        return blockNumber;
    }

    public void setBlockNumber(BigDecimal blockNumber) {
        this.blockNumber = blockNumber;
    }

    public BigDecimal getAbleAmount() {
        return ableAmount;
    }

    public void setAbleAmount(BigDecimal ableAmount) {
        this.ableAmount = ableAmount;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getIsSale() {
        return isSale;
    }

    public void setIsSale(Integer isSale) {
        this.isSale = isSale;
    }

    public String getBitAddress() {
        return bitAddress;
    }

    public void setBitAddress(String bitAddress) {
        this.bitAddress = bitAddress;
    }

    public String getMemberName() {
        return memberName;
    }

    public void setMemberName(String memberName) {
        this.memberName = memberName;
    }

    public String getMemberMobile() {
        return memberMobile;
    }

    public void setMemberMobile(String memberMobile) {
        this.memberMobile = memberMobile;
    }

    public String  getTypeStr(){
        String typeStr= "";
        if(type==null)return typeStr;

        switch (type) {
            case 1:
                typeStr="买入";
                break;
            case 2:
              //  ，3退出区块链，4消费卡转入
                typeStr="卖出";
                break;
            case 3:
                typeStr="退出区块链";
                break;
            case 4:
                typeStr="消费卡转入";
                break;
            default:
                break;
        }
        return typeStr;
    }
    public String  getStatusStr(){
        String statusStr= "";
        if(status==null)return statusStr;

        switch (status) {
            case 1:
                statusStr="委托中";
                break;
            case 2:
                statusStr="已成交";
                break;
            default:
                break;
        }
        return statusStr;
    }

    public Date getSaleTime() {
        return saleTime;
    }

    public void setSaleTime(Date saleTime) {
        this.saleTime = saleTime;
    }
}
